package com.github.prontera.controller;

import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.github.prontera.ApiVersion;
import com.github.prontera.domain.Order;
import com.github.prontera.model.response.ObjectDataResponse;
import com.github.prontera.service.OrderService;
import com.github.prontera.service.UserService;
import com.github.prontera.util.Page;

/**
 * 订单管理
 * @author Mengxiangdong
 */
@RestController
@RequestMapping(value = ApiVersion.MANAGE_V1_PREFIX + "/order", produces = { MediaType.APPLICATION_JSON_UTF8_VALUE }, consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE })
public class OrderController {

	
	@Autowired
	private UserService userService;
	
	@Autowired
	private OrderService orderService;

	@ApiOperation(value = "查询订单列表", notes = "查询订单列表")
	@RequestMapping(value = "/queryOrder", method = RequestMethod.POST)
	@ResponseBody
	public ObjectDataResponse<Page<Order>> queryOrder(@RequestBody Order order) {

		Page<Order> datas = orderService.page(order);
		return new ObjectDataResponse<Page<Order>>(datas);
	}

}
